<?php

namespace app\common\validate;

use app\common\validate\Base;
class Coin extends Base
{

    protected $rule = [
        'id|货币ID' => 'require|integer',
        'coin_id' => 'require|integer',
        'coin_name|货币名称' => 'require',
        'tag|货币别名' => 'require|alphaDash',
        'type|配置类型' => 'require',
        'config|配置比率' => 'require|between:1,100'
    ];

    protected $message = [

    ];

    protected $scene = [
        // 新增货币
        'manage_add' => ['coin_name','tag'],
        // 编辑货币
        'manage_edit' => ['id','coin_name','tag'],
        // 删除货币
        'manage_del' => ['id'],
        // 后台添加货币配置
        'manage_coin_config' => ['coin_id','config','type']
    ];

    /**
     * 
     * @param  [type] $v    [description]
     * @param  [type] $rule [description]
     * @param  [type] $data [description]
     * @return [type]       [description]
     */
    protected function checkData($v,$rule,$data){
        
    }

}